package com.spzx.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: jaykim
 * @created: 2023/11/30
 */
@Configuration
public class knife4jConfig {

    @Bean
    public GroupedOpenApi adminApi(){
        return GroupedOpenApi.builder() //创建一个api接口分组
                .group("admin-api") //分组名
                .pathsToMatch("/admin/**0") //接口请求路径规则
                .build();
    }

    @Bean
    public OpenAPI customOpenApi(){
        return new OpenAPI()
                .info(new Info()
                        .title("spzx-API接口文档")
                        .version("1.0")
                        .description("spzx接口文档")
                        .contact(new Contact().name("jaykim"))
                );
    }
}
